package com.js.service;


import com.js.dao.BookDao;
import com.js.pojo.Book;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/*
 * Author：江松
 * Date：2023/4/25 9:44
 */
@Service
public class BookService {
    @Autowired
    BookDao bookDao;

    public List<Book> listBooks() {
        return bookDao.listBooks();
    }

    public List<Book> likeBooks(String subName){
        return bookDao.likeBooks(subName);
    }

    public Book findBookByName(String bookname) {
        return bookDao.findBookByName(bookname);
    }


    public int updateBook(Book book) {
        return bookDao.updateBook(book);
    }


    public int delBool(Integer bookid) {
        return bookDao.delBook(bookid);
    }


    public int addBook(Book book) {
        return bookDao.addBook(book);
    }


    public int borrowBook(Integer bookid) {
        return bookDao.borrowBook(bookid);
    }


    public int returnBook(Integer bookid) {
        return bookDao.returnBook(bookid);
    }

    public int borrowBookProc(Integer bookid,Integer userid){
        return bookDao.borrowBookProc(bookid,userid);
    }

    public int returnBookProc(Integer bookid,Integer userid){
        return bookDao.returnBookProc(bookid,userid);
    }

}
